import { createBrowserRouter } from 'react-router-dom'
import App from '../App'

const routers = createBrowserRouter([
    {
        path: '/',
        element: <App />,
        children: [
            {
                path: '/home',
                async lazy() {
                    const { default: Home } = await import('../pages/home/Index')
                    return {
                        element: <Home />
                    }
                }
            },
            {
                path: '/message',
                async lazy() {
                    const { default: Message } = await import('../pages/message/Index')
                    return {
                        element: <Message />
                    }
                }
            },
            {
                path: '/my',
                async lazy() {
                    const { default: My } = await import('../pages/my/Index')
                    return {
                        element: <My />
                    }
                }
            },
            {
                path: '/todo',
                async lazy() {
                    const { default: Todo } = await import('../pages/todo/Index')
                    return {
                        element: <Todo />
                    }
                }
            },
            {
                path: '/store',
                async lazy() {
                    const { default: Store } = await import('../pages/store/Index')
                    return {
                        element: <Store />
                    }
                }
            },
        ]
    },
    {
        path: '/login',
        async lazy() {
            const { default: Login } = await import('../pages/login/Index')
            return {
                element: <Login />
            }
        }
    },
    {
        path: '/about_us',
        async lazy() {
            const { default: About_us } = await import('../pages/about_us/Index')
            return {
                element: <About_us />
            }
        }
    },
    {
        path: '/address',
        async lazy() {
            const { default: Address } = await import('../pages/address/Index')
            return {
                element: <Address />
            }
        }
    },
    {
        path: '/card',
        async lazy() {
            const { default: Card } = await import('../pages/card/Index')
            return {
                element: <Card />
            }
        }
    },
    {
        path: '/public_Notice',
        async lazy() {
            const { default: Public_Notice } = await import('../pages/Public_Notice/Index')
            return {
                element: <Public_Notice />
            }
        }
    },
    {
        path: '/privacy_Policy',
        async lazy() {
            const { default: Privacy_Policy } = await import('../pages/privacy_Policy/Index')
            return {
                element: <Privacy_Policy />
            }
        }
    },
     {
        path: '/agreement',
        async lazy() {
            const { default: Agreement } = await import('../pages/Agreement/Index')
            return {
                element: <Agreement />
            }
        }
    },
])
export default routers;